<template>
  <div>
      我是Home --  
      <div>
          <button @click="push">点我跳转</button>
          <button @click="getRoute">点我获取路由信息</button>
      </div>
  </div>
</template>

<script>
// 路由跳转
import { useRouter, useRoute } from 'vue-router'
export default {
    setup() {
        const router = useRouter()
        const route = useRoute()
        console.log(route)

        const push = () => {
            router.push('/about')
        }

        const getRoute = () => {
            // this.$route
            console.log(route.path)
        }
        return {
            push,
            getRoute
        }
    }
}
</script>

<style>

</style>